<?php
	$tid = intval(htmlentities(trim($_POST['tid'])));
	$tName = htmlentities(trim($_POST['tName']));
	if($tid == 'all' || !is_int($tid)){exit('err');}
	require '../autoload.php';
	$mp = new MyPdo();
	$sql = 'select lefts from translate_info where typeid = ?';
	$arr = array($tid);
	$res = $mp->dql($sql,$arr);
	if($res){
		$dir = '../Runtime/CacheInfoAll/';
		$file = $dir.'/'.$tName;
		if(!is_dir($dir)){
			mkdir($dir,0777,true);
		}
		ob_start();
		echo json_encode($res);
		$res2 = ob_get_contents();
		file_put_contents($file,$res2);
	}